# -*- coding:utf-8 -*-
# @Author: wg
# @Time: 2018/12/17 10:12
# @Desc: 主项目文件
from app import app
import click
# from app.extensions import db
from app.models import FanTaskDetail, db
from datetime import datetime  #
# from flask_script import Manager, prompt_bool


# manager = Manager(create_app())
#
#
# @manager.command
# def create_all():
#     """
#     Creates database tables
#     :return:
#     """
#     print("创建数据库")
#     db.create_all()
#
#
# @manager.command
# def drop_all():
#     """
#     Drops all database tables
#     :return:
#     """
#     if prompt_bool("Are you sure ? You will lose all your data !"):
#         print("删除数据库!")
#         db.drop_all()


if __name__ == '__main__':
    print(
        f"############# flask start {datetime.utcnow()} ###########")  # 打印两次原因 https://stackoverflow.com/questions/25504149/why-does-running-the-flask-dev-server-run-itself-twice
    # manager.run()
    # channel_name = FanTaskDetail(33, "内容33", "评论33")
    # db.session.add(channel_name)
    # 更改
    # db.session.query(FanTaskDetail).filter_by(task_id=22).update({'task_content': '内容被修改'})
    # # print(channel_name.task_id)  # None
    # db.session.commit()
    # print(channel_name.task_id)
    app.run()
